/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ces31.ChineseDicesServer;

import java.rmi.server.UnicastRemoteObject;
import ces31.ChineseDicesCommon.*;
import ces31.ChineseDicesServer.RN.RN_SalaDeEspera;
import java.rmi.RemoteException;

/**
 *
 * @author Anderson Aiziro
 */
public class SO_Servidor_Facade extends UnicastRemoteObject implements ServidorInterface {

    public SO_Servidor_Facade() throws RemoteException {
        super();
    }

    public void conectarJogador(String IPUser, String name) throws RemoteException {
        waitingRoom.conectarJogador(IPUser, name);
    }

    public void desconectarJogador(String name) throws RemoteException {
        waitingRoom.desconectarJogador(name);
    }

    public void finalizarJogoPorDesistencia(ClienteInterface client) throws RemoteException {
        waitingRoom.getJogo().finalizarJogoPorDesistencia(client);
    }

    public void finalizarRodada() throws RemoteException {
        waitingRoom.getJogo().finalizarRodada();
    }

    public void encaminharAfirmacao(ClienteInterface client, Integer quantity, Integer value) throws RemoteException {
        waitingRoom.getJogo().getRodada().encaminharAfirmacao(client, quantity, value);
    }

    public RN_SalaDeEspera getWaitingRoom() {
        return waitingRoom;
    }

    public void setWaitingRoom(RN_SalaDeEspera waitingRoom) {
        this.waitingRoom = waitingRoom;
    }
    private RN_SalaDeEspera waitingRoom = RN_SalaDeEspera.instanciaDe();
}
